home *** CD-ROM | disk | FTP | other *** search
/ Programming Sound Cards / Programming Sound Cards.iso / sound_52 / wtable.ma < prev   
Text File  |  1995-01-01  |  1KB  |  62 lines

  1. @include \mbin\mh\wind.mh
  2.  
  3. #
  4. # Demo of WTABLE 2d array editor.
  5. # setup as an array of notes.
  6. #
  7.  
  8. NOROWS = 10
  9. NOCOLS = 3
  10. uchar x[NOROWS][NOCOLS] = {
  11.     LC, q, 100,
  12.     LD, q, 100,
  13.     LE, q, 100,
  14.     LF, q, 100,
  15.     LG, q, 100,
  16.     LA, q, 100,
  17.     LB, q, 100,
  18.     C, q, 100,
  19.     D, q, 100,
  20.     E, q, 100 
  21. }
  22. LSIZE = 4   # max label size
  23. FSIZE = 4   # field size 
  24.  
  25. riff openWindows()
  26.     int wd
  27.  
  28. #    void mosWindow(WVCO,0,0)
  29. #    void mosWindow(WRCC,10,0)
  30.     void outputWindow(WDEBUG,17,0,23,25,"printf") # halfway
  31.  
  32.     # NUMERIC window - set values in 1 dim uchar array,
  33.     #    1 to N elements.
  34.     #    upX,upY
  35.     #    lowX,lowY
  36.     #    title string
  37.     #    nolabels = 1    must be 1
  38.     #    fieldsize = 5
  39.     #    nofields = 3
  40.     #    pointer to uchar array of size 1-n
  41.     #        should not wrap off screen!
  42.     #        size of array >= nofields
  43.      wd = inputMWindow(WTABLE, 0, 0, NOROWS+1, NOCOLS*4+2+LSIZE, "note array", LSIZE, FSIZE, 0, &x)
  44.     void windowControl(wd, NOTETRANSLATION, 0, 0)
  45.     void windowControl(wd, TIMETRANSLATION, 1, 0)
  46.     void windowControl(wd, VELTRANSLATION, 2, 0)
  47.  
  48. end
  49.  
  50. vco testit()
  51.     int i
  52.      void openWindows()
  53.     for(;;)
  54.         rest    w
  55.         for ( i = 0; i < NOROWS; i++)
  56.             void printf("note %n %t %v",x[i][0],x[i][1],x[i][2])
  57.             rest    q
  58.         end
  59.     end
  60. end
  61.  
  62.